/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sdd.facades.view;

import com.sdd.facades.business.AddressBusinessFacadeBean;
import com.sdd.facades.factories.AddressFactoryFacadeBean;
import com.sdd.plains.AddressPlain;
import javax.ejb.EJB;
import javax.ejb.Stateless;

/**
 *
 * @author Carlos
 */
@Stateless
public class AddressViewFacadeBean implements AddressViewFacade{
    @EJB
    AddressBusinessFacadeBean addressBusinessFacadeBean;
    @EJB
    AddressFactoryFacadeBean addressFactoryFacadeBean;

    @Override
    public AddressPlain getAddress(long addressId) {
        return addressFactoryFacadeBean.createAddressPlain(addressBusinessFacadeBean.getAddress(addressId));
    }

    @Override
    public AddressPlain addAddress(AddressPlain address) {
        return addressFactoryFacadeBean.createAddressPlain(addressBusinessFacadeBean.addAddress(address));
    }

}
